package com.itobase.statusDetect.Controller;

import com.itobase.statusDetect.Model.Client;
import com.itobase.statusDetect.Model.User;
import com.itobase.statusDetect.Repository.UserRepository;
import com.itobase.statusDetect.Util.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.*;

@RestController
public class HelloController {

    @Autowired
    UserRepository userRepository;

    @GetMapping("/hello")
    public Message helloTest(){
        return Message.success("你好");
    }

    @GetMapping("/client/getCourse")
    public Message getTest(@RequestParam String id,@RequestParam String timeID) {

        HashMap<String, Object> map = new HashMap<>();

        Client client_1 = new Client("计算机组成原理", "章铁飞", 9.5);
        Client client_2 = new Client("大学物理（下）", "谢飞", 6.0);
        Client client_3 = new Client("现代", "吴波", 8.5);

        List<Client> list = new ArrayList<>();

        list.add(client_1);

        list.add(client_2);

        list.add(client_3);

        map.put("id", "5c399aa80070d306c089cbe0");
        map.put("name", "郑颖");
        map.put("courseList",list);

        return Message.success(map);

    }




}



